.customerServicePage {
  min-height: 100vh;
  background-color: #f5f5f5;
  padding-bottom: 80px;
  overflow-x: hidden;
  max-width: 100vw;
}

.chatContainer {
  margin-top: 100px;
  padding: 16px;
  max-width: 100%;
  overflow: hidden;
}

.uploadBar { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.uploadBar audio {
  width: 100%;
  max-width: 320px;
  height: 36px;
  border-radius: 10px;
  background: #e9f2ff;
}
.fileLink {
  color: #1677ff;
  cursor: pointer;
  display: inline-block;
  margin: 8px 0;
  padding: 8px 12px;
  background: #f0f9ff;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

/* 图片消息仅展示缩略图，不显示描述：不需要额外样式，这里保留文件样式供非图片使用 */

.fileLink:hover {
  background: #e6f7ff;
  transform: translateY(-2px);
}

.imageThumbnail {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #f0f0f0;
}

.imageThumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.imageOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.imageFullscreen {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  cursor: grab;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.imageFullscreen:active {
  cursor: grabbing;
}

.imageOverlay {
  overflow: hidden;
}

.uploadProgress {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.uploadBar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 消息组 */
.messageGroup {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 12px;
}

.messageGroup.userMessage { flex-direction: row-reverse; }
.messageGroup.userMessage .messageBubble { order: 1; }
.messageGroup.userMessage .userAvatar { order: 2; }
.messageGroup.userMessage .aiAvatar { display: none; }

/* 头像 */
.aiAvatar, .userAvatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
}

.aiAvatar {
  background: #007bff;
}

.userAvatar {
  background: #28a745;
}

.messageBubble {
  background: #f0f0f0;
  border-radius: 18px;
  padding: 12px 16px;
  max-width: 70%;
  width: fit-content;
  word-break: break-word;
}

/* 语音消息更精美的外观 */
.voiceBubble {
  background: linear-gradient(90deg, #e6f0ff 0%, #f4f9ff 100%);
  padding: 10px 12px;
  border-radius: 18px;
}
.voiceBubble audio::-webkit-media-controls-enclosure {
  border-radius: 12px;
}
.voiceBubble audio {
  width: 220px;
}

.userBubble {
  background: #007bff;
  color: white;
}

.messageText {
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  margin-bottom: 4px;
}

.userBubble .messageText {
  color: white;
}

.messageText:last-child {
  margin-bottom: 0;
}

/* 加载状态 */
.loadingText {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #666;
  font-size: 14px;
}

.typingIndicator {
  color: #666;
}

.typingDots {
  animation: typing 1.5s infinite;
}
@keyframes typing {
  0%, 20% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* 推荐问题卡片 */
.suggestedCard {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 80%;
}

.cardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cardTitle {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.refreshBtn {
  color: #007bff;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

.refreshBtn:hover {
  color: #0056b3;
}

/* 问题列表 */
.questionsList {
  margin-bottom: 20px;
}

.questionItem {
  padding: 8px 0;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: color 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.questionItem:hover {
  color: #007bff;
}

.questionItem:last-child {
  border-bottom: none;
}

/* 推荐操作区域 */
.actionsSection {
  border-top: 1px solid #f0f0f0;
  padding-top: 16px;
}

.actionsTitle {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.actionsGrid {
  display: flex;
  gap: 12px;
}

.actionItem {
  flex: 1;
  background: #e3f2fd;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.actionItem:hover {
  transform: translateY(-2px);
}

.actionIcon {
  font-size: 24px;
  margin-bottom: 6px;
}

.actionText {
  font-size: 12px;
  color: #007bff;
  font-weight: 500;
}

/* 底部输入框 */
.inputContainer {
  position: fixed;
  bottom: 0px;
  left: 0;
  right: 0;
  background: white;
  padding: 8px 16px 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

/* 上排：+号和表情按钮 */
.topRow {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

/* 下排：输入框和发送按钮 */
.bottomRow {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 左侧功能按钮 */
.leftButtons {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 中间输入区域 */
.inputArea {
  flex: 1;
  display: flex;
  align-items: center;
}

/* 文本输入框包装器 */
.textInputWrapper {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

/* 语音切换按钮（在输入框内部右侧） */
.voiceToggleBtn {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.voiceToggleBtn:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

/* 发送按钮包装器 */
.sendBtnWrapper {
  flex-shrink: 0;
}

/* 功能按钮 */
.funcBtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.funcBtn:hover {
  background: #e0e0e0;
  transform: scale(1.05);
}

.funcBtn.active {
  background: #007bff;
  color: white;
}

/* 语音输入模式 */
.voiceInput {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  background: #f8f9fa;
  border-radius: 20px;
  border: 1px solid #e9ecef;
  position: relative;
}

.voiceText {
  color: #6c757d;
  font-size: 14px;
  flex: 1;
  text-align: center;
  margin-right: 40px;
}

/* + 号功能菜单 */
.plusMenu {
  position: absolute;
  bottom: 120px;
  left: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-width: 160px;
  z-index: 1000;
}

.plusMenu::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}

.menuItem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.menuItem:hover {
  background: #f8f9fa;
  transform: scale(1.05);
}

.menuIcon {
  font-size: 24px;
}

.menuText {
  font-size: 12px;
  color: #495057;
  font-weight: 500;
}

/* Emoji 选择菜单 */
.emojiMenu {
  position: absolute;
  bottom: 120px;
  left: 60px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  width: 320px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

/* 确保emoji菜单不超出屏幕右边界 */
@media (max-width: 400px) {
  .emojiMenu {
    width: calc(100vw - 120px);
    left: 60px;
    right: 16px;
  }
}

.emojiMenu::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}

.emojiItem {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  user-select: none;
}

.emojiItem:hover {
  background: #f8f9fa;
  transform: scale(1.2);
}

.voiceBtn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.voiceBtn:hover {
  background: #e0e0e0;
}

.voiceBtn.recording {
  background: #ff4444;
  color: white;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.textInput {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 40px 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.textInput:focus {
  border-color: #007bff;
}

.textInput:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.sendBtn {
  padding: 10px 16px;
  background: #007bff;
  color: white;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.sendBtn:hover:not(.disabled) {
  background: #0056b3;
}

.sendBtn.disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 375px) {
  .chatContainer {
    padding: 12px;
  }
  
  .suggestedCard {
    max-width: 85%;
  }
  
  .actionsGrid {
    gap: 8px;
  }
  
  .actionItem {
    padding: 10px 6px;
  }
  
  .actionIcon {
    font-size: 20px;
  }
  
  .actionText {
    font-size: 11px;
  }
}

